/*
 * Systemprogrammierung
 * Multiplayer-Quiz
 *
 * Gemeinsam verwendete Module
 *
 * sockets.h: Header für die Socket-Funktionen zum Senden und Empfangen
 */

#ifndef SOCKETS_H
#define SOCKETS_H
#include "common/rfc.h"
#include "common/util.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include <stdbool.h>

/* ** ** ** Öffentliche Funktionen ** ** ** */

int create_client_socket(char **);
int create_server_socket(unsigned short);
int send_MSG(int, uint8_t, uint16_t, void*);
int receive_MSG(int, struct RFC_MSG*);
int send_err_MSG(int, uint8_t, char*);
int catch_com_err();
int connection_check(int);

#endif
